1. Field of the Invention
This invention relates generally to compressed memory systems, and more specifically, to a software technique for managing and controlling a compressed memory system in a manner transparent to the operating system.
2. Discussion of the Prior Art
In computer systems it is customary that there be one-to-one correspondence between the memory address produced by the processor and a specific area in the physical memory of the system. It is an error for the processor to request access to an address which does not have an associated physical memory area. This limits the operating system and applications to an address space determined by the actual physical memory installed in the system. Modern computer systems have overcome this limitation through the use of virtual memory which implements a translation table (TT) to map program (virtual) addresses to real memory addresses.
With virtual memory the program works in an address space limited only by the processor architecture. It is a function of the operating system to ensure that the data and code a program is currently using is in main memory and that the translation table can map the virtual address to the real address correctly. In a virtual memory system the allocation of memory is most commonly performed by the operating system software. This requires an interrupt of the instruction sequence so that the privileged kernel code can allocate physical memory to the area being accessed so that normal program flow can continue without error. This interrupt and the kernel processing to allocate physical memory requires a significant amount of processing time and upsets the normal pipelining of instructions through the CPU.
There currently exist schemes for reducing operating system process interruptions. For instance, the reference entitled “Design and Analysis of Internal Organizations for Compressed Random Access Memories” by Peter A. Franaszek and John T. Robinson, IBM Research Report RC21146(94535), dated Oct. 28, 1998, describes a low level main memory design for storing compressed data that includes a directory portion and a collection of fixed size blocks which are used to store lines in compressed format. In the memory storage scheme described herein therein, highly compressible lines may be stored entirely within a directory entry; otherwise, the directory entry points to one or more of the fixed size blocks which are used to store the line in compressed format. The system further makes use of page tables which translate virtual addresses to real addresses which correspond to the location in the directory of the directory entry for the line and which includes information pertaining to blocks holding a compressed line. Specifically, the information in a directory entry includes flags, fragment combining information, and, assuming fixed size entry structure, pointers to one or more fixed size blocks. On a cache miss, the memory controller and decompression hardware finds the blocks allocated to store the compressed line and dynamically decompresses the line to handle the miss. Similarly, when a new or modified line is stored, the blocks currently allocated to the line are made free (if the line currently resides in the RAM), the line is compressed, and then stored in the RAM by allocating the required number of blocks.
Furthermore, U.S. Pat. No. 5,761,536 is directed to a memory organization technique utilizing a compression control device for storing variable length objects (compressed memory) in fixed-size storage blocks by enabling fixed size storage blocks to receive remaining portions (leftover compressed memory pieces or fragments) of variable length objects that take up less than a full fixed-size storage block. The system thus reduces memory fragmentation.
U.S. Pat. No. 5,864,859 is directed to a compression store addressing technique for storing variable length objects (compressed lines, each representing, e.g., ¼ of a page) in fixed size blocks so that accessing an individual line may be accomplished quickly and with little change to existing software. In particular, the beginning of any line within a page may be accessed with a single pointer plus an offset. Associated with the compression store is a list of free or available blocks (free list) which is accessed for enabling variable length object storage.
Commonly-owned, co-pending U.S. patent application Ser. No. 09/627,516 entitled DYNAMIC ALLOCATION OF PHYSICAL MEMORY SPACE describes a mechanism that enables the physical memory to be dynamically allocated in a manner such that the interruption in program flow is eliminated.
As the amount of physical memory in a computer is limited due to cost and space, operating systems (O/S) have employed techniques that enable many concurrently running applications to share a common pool of physical memory. Above-described co-pending U.S. patent application Ser. No. 09/627,516 further describes a mechanism that facilitates the management of memory pools so that the various processes and users share the system resources fairly.
In general, current operating systems use a kernel software component called a Virtual Memory Manager (VMM) to provide an illusion of a flat, contiguous memory space equal to the amount of memory that can be addressed by the processor to running applications. The O/S reserves a portion of the memory space as its own and allows the applications to have access to the rest of the virtual address space. In reality, the applications only have a relatively small portion of their address space in memory and the rest of application data memory is swapped to disk until the application makes reference to the swapped memory. The VMM then swaps in the requested portion of memory.
It follows that in systems with large amounts of physical memory, performance is better since the O/S can allow applications to have larger segments of data resident in memory, thus reducing the need for swapping to and from disk.
In a system where memory compression is employed, the amount of physical memory appears to the O/S to be much greater than is actually installed. The amount of memory presented to the O/S as installed in the computer is called real memory. The ratio of real memory to physical memory is called the boot compression ratio of the computer system. As long as the data that is being contained in the memory remains compressible at a rate greater than or equal to boot compression ratio, the system can run correctly. However, in the case where the compression ratio of the data residing in memory deteriorates to the point of requiring more physical space than is available, software components are employed to throttle back the usage of real memory such that there always is enough physical memory in which to contain the application and O/S data.
This throttling mechanism may be implemented in one of two ways: 1) by modifications to the VMM in the O/S kernel itself; or, 2) a package of software that runs outside of and separate from the O/S.
It would be highly desirable to provide an improved throttling mechanism that is implemented without modifications to the O/S kernal software and operates transparent to the O/S.